package com.kaigejava.kgblog.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.kaigejava.kgblog.dao.auto.TblArchiveMapper;
import com.kaigejava.kgblog.model.auto.TblArchive;
import com.kaigejava.kgblog.model.auto.TblArchiveExample;
import com.kaigejava.kgblog.service.ITblArchiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by kaigejava on 2018/7/26.
 */
@Service(value = "archiveService")
public class TblArchiveServiceImpl implements ITblArchiveService {

    @Autowired
    private TblArchiveMapper tblArchiveMapper;
    @Override
    public PageInfo<TblArchive> findAllArchive(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        TblArchiveExample example = new  TblArchiveExample();
        List<TblArchive> list  = tblArchiveMapper.selectByExample(example);
        PageInfo result = new PageInfo(list);
        return result;
    }
}
